*REPLICATION STATA .do FILE FOR "Administrative Burdens and Citizen Likelihood to Seek Local Public Services..."

*****

*CLEAR
clear

*****

*GET DATA
use ""

*****

*GET VARIABLES

keep Q4 Q3 Q80 Q14_1 Q14_2 Q14_3 Q14_4 Q14_5 Q14_6 Q26 Q31 Q32 Q13 Q59 Q5 Q9 Q6 Q62_1 Q62_2 Q62_3 Q62_4 Q62_5 Q62_5 Q23 Q24 Q35_19 Q107_1 Q107_2 Q107_3 Q107_4 Q107_5 Q107_6 Q107_7 Q107_8 Q107_9 Q107_10 Q107_11 Q28 Q30 Q30a Q49a Q49b Q49c Q49d Q50a Q50b Q50c Q50d Q50e Q51a Q51b

*****


*DESCRIPTIVES OF SAMPLE TO COMPARE TO ACS
*note: qualtrics samples on sex, age, income, and race (w/ race oversample)

*sex
tab Q4
	*recode so 1 = female, 0 = male
gen female=.
replace female=1 if Q4==2
replace female=0 if Q4==1
tab female Q4

*age
tab Q3

*income
tab Q80
	*recode to clean up scale
gen income=.
replace income=1 if Q80==1
replace income=2 if Q80==2
replace income=3 if Q80==3
replace income=4 if Q80==5
replace income=5 if Q80==6
replace income=6 if Q80==7
replace income=7 if Q80==9
tab Q80 income
	*create above/below avergae summary
summarize income
		*note: mean of the above = 3.317026 
gen inc_above_ave=.
replace inc_above_ave=0 if income < 3.317026
replace inc_above_ave=1 if income > 3.317026
tab inc_above_ave
tab inc_above_ave income

*race
	*white
tab Q14_1
	*blk
tab Q14_2
	*hisp
tab Q14_3
	*asian
tab Q14_4
	*nat am
tab Q14_5
	*other
tab Q14_6
	*create white only indicator
		*n = 149 white hisp/lat
tab Q14_1 Q14_3
gen white=0
replace white=1 if (Q14_1==1) & (Q14_2 != 1) & (Q14_3 != 1) & (Q14_4 != 1) & (Q14_5 != 1) & (Q14_6 != 1)
tab white Q14_1

*****


*CASE SELECTION: responses specifically to irma
	*what did you do
tab Q26
	*create category for 1 = public shelter, 2 = remain in residence, 3 = evac w/o shelter
gen irma_resp=.
replace irma_resp=2 if Q26==1
replace irma_resp=3 if Q26==2
replace irma_resp=3 if Q26==3
replace irma_resp=3 if Q26==4
replace irma_resp=1 if Q26==5
tab irma_resp
tab Q26 irma_resp

	*summary stats on remained in residence
generate residence=.
replace residence=0 if Q26==2 | Q26==3 | Q26==4 | Q26==5
replace residence=1 if Q26==1
tab Q26 residence
summarize residence

	*Figure 1: break this out by those who left home by type of modality (i.e., excluding those who stayed in residence)
		*airplane
generate plane=.
replace plane=0 if Q26==3 | Q26==4 | Q26==5
replace plane=1 if Q26==2
		*bus
generate bus=.
replace bus=0 if Q26==2 | Q26==4 | Q26==5
replace bus=1 if Q26==3
		*car
generate car=.
replace car=0 if Q26==2 | Q26==3 | Q26==5
replace car=1 if Q26==4
		*shelter
generate shelter=.
replace shelter=0 if Q26==2 | Q26==3 | Q26==4
replace shelter=1 if Q26==5
		*check coding
tab Q26
tab plane
tab bus
tab car
tab shelter
		*get means for the figure
mean plane
mean bus
mean car
mean shelter
		*descriptives
summarize plane
summarize bus
summarize car
summarize shelter

	*possible covariates of responses to irma (note: three categories: shelter, remain in residence, all other forms of evacuation)
		*DV/all respondents
generate s_home_oth=.
replace s_home_oth=2 if Q26==1
replace s_home_oth=3 if Q26==2
replace s_home_oth=3 if Q26==3
replace s_home_oth=3 if Q26==4
replace s_home_oth=1 if Q26==5
tab Q26 s_home_oth
label define whatdo_label 1 "shelter" 2 "home" 3 "all others"
label values s_home_oth whatdo_label
tab s_home_oth

		*evac order
			*code mandatory
generate mandatory=.
replace mandatory=1 if Q31==1
replace mandatory=0 if Q31==2
tab Q31
tab mandatory	
			*code voluntary
generate vol=.
replace vol=1 if Q32==1
replace vol=0 if Q32==2
tab Q32
tab vol
			*combine the two
generate evac_ord=0
replace evac_ord=1 if mandatory==1 | vol==1
tab evac_ord
tab mandatory vol
tab Q31
tab Q32
summarize evac_ord
			*x-tab
tab evac_ord s_home_oth, row chi2

		*age
			*bin age
encode Q3, generate(age)
summarize age
tab age
generate age_bin=.
replace age_bin=1 if age <= 25
replace age_bin=2 if age > 25 & age <= 49
replace age_bin=3 if age >= 50
tab age_bin
			*x-tab
tab age_bin s_home_oth, row chi2

		*income
			*bin income
tab Q80
generate inc_bin=.
replace inc_bin=1 if Q80==1
replace inc_bin=2 if Q80==2
replace inc_bin=3 if Q80==3
replace inc_bin=4 if Q80==5
replace inc_bin=5 if Q80==6
replace inc_bin=6 if Q80==7
replace inc_bin=6 if Q80==9
tab Q80 inc_bin
			*x-tab
tab inc_bin s_home_oth, row chi2

		*education
			*x-tab
tab Q13 s_home_oth, row chi2

		*race
			*create white vs all others
generate nonwhite=.
replace nonwhite=1 if Q14_1==.
replace nonwhite=0 if Q14_1==1
tab Q14_1 nonwhite
			*x-tab
tab nonwhite s_home_oth, row chi2

		*financial stability
			*x-tab
tab Q59 s_home_oth, row chi2

		*home ownership
			*x-tab
tab Q5 s_home_oth, row chi2

		*pet ownership
			*x-tab
tab Q9 s_home_oth, row chi2

		*flood zone
			*x-tab
tab Q6 s_home_oth, row chi2

		*physical mobility
			*bin to yes vs no from the check all that apply battery
generate notmobile=.
replace notmobile=1 if Q62_1 == 1 | Q62_2 == 1 | Q62_3 == 1 | Q62_4 == 1
replace notmobile=0 if Q62_5==1
tab notmobile
tab Q62_5 notmobile
summarize notmobile
			*x-tab
tab notmobile s_home_oth, row chi2

		*perceptions of preparedness
			*bin preparedness scale (note: this drops "not in hurricane's path")
generate prep=.
replace prep=1 if Q23==1
replace prep=1 if Q23==2
replace prep=2 if Q23==3
replace prep=2 if Q23==4
tab Q23 prep
			*x-tab
tab prep s_home_oth, row chi2

		*qualtiy of residence construction
			*bit scale (note: drops "neither")
generate qualhouse=.
replace qualhouse=1 if Q24==8
replace qualhouse=1 if Q24==9
replace qualhouse=2 if Q24==11
replace qualhouse=2 if Q24==12
tab Q24 qualhouse
			*x-tab
tab qualhouse s_home_oth, row chi2

		*ride it out mentality
			*bin scale
tab Q35_19
generate ride_bin=.
replace ride_bin=1 if Q35_19==1
replace ride_bin=1 if Q35_19==2
replace ride_bin=1 if Q35_19==3
replace ride_bin=2 if Q35_19==4
replace ride_bin=2 if Q35_19==5
replace ride_bin=2 if Q35_19==6
replace ride_bin=2 if Q35_19==7
replace ride_bin=3 if Q35_19==8
replace ride_bin=3 if Q35_19==9
replace ride_bin=3 if Q35_19==10
tab Q35_19 ride_bin
			*x-tab
tab ride_bin s_home_oth, row chi2

		*supplies on hand
			*generate individual items
generate food=.
replace food=1 if Q107_1==1
replace food=1 if Q107_1==2
replace food=0 if Q107_1==3
replace food=1 if Q107_1==4
tab Q107_1 food
generate water=.
replace water=1 if Q107_2==1
replace water=1 if Q107_2==2
replace water=0 if Q107_2==3
replace water=1 if Q107_2==4
tab Q107_2 water
generate flight=.
replace flight=1 if Q107_3==1
replace flight=1 if Q107_3==2
replace flight=0 if Q107_3==3
replace flight=1 if Q107_3==4
tab Q107_3 flight
generate candle=.
replace candle=1 if Q107_4==1
replace candle=1 if Q107_4==2
replace candle=0 if Q107_4==3
replace candle=1 if Q107_4==4
tab Q107_4 candle
generate batt=.
replace batt=1 if Q107_5==1
replace batt=1 if Q107_5==2
replace batt=0 if Q107_5==3
replace batt=1 if Q107_5==4
tab Q107_5 batt
generate radio=.
replace radio=1 if Q107_6==1
replace radio=1 if Q107_6==2
replace radio=0 if Q107_6==3
replace radio=1 if Q107_6==4
tab Q107_6 radio
generate gen=.
replace gen=1 if Q107_7==1
replace gen=1 if Q107_7==2
replace gen=0 if Q107_7==3
replace gen=1 if Q107_7==4
tab Q107_7 gen
generate sand=.
replace sand=1 if Q107_8==1
replace sand=1 if Q107_8==2
replace sand=0 if Q107_8==3
replace sand=1 if Q107_8==4
tab Q107_8 sand
generate shutter=.
replace shutter=1 if Q107_9==1
replace shutter=1 if Q107_9==2
replace shutter=0 if Q107_9==3
replace shutter=1 if Q107_9==4
tab Q107_9 shutter
generate glass=.
replace glass=1 if Q107_10==1
replace glass=1 if Q107_10==2
replace glass=0 if Q107_10==3
replace glass=1 if Q107_10==4
tab Q107_10 glass
generate gun=.
replace gun=1 if Q107_11==1
replace gun=1 if Q107_11==2
replace gun=0 if Q107_11==3
replace gun=1 if Q107_11==4
tab Q107_11 gun
			*generate count
generate supplied=food+water+flight+candle+batt+radio+gen+sand+shutter+glass+gun
tab supplied
summarize supplied
			*bin for above below average
generate ave_sup=.
replace ave_sup=1 if supplied >= 9.9
replace ave_sup=2 if supplied < 9.9
tab ave_sup supplied
			*x-tab
tab ave_sup s_home_oth, row chi2	

	*multivariate analysis of shelter use (v.s. all others; i.e., take all of the exploratory x-tabs above and put into mulitvariate)
		*DV: shelter vs all others
generate s_v_all=0
replace s_v_all=1 if shelter==1
tab Q26 s_v_all
summarize s_v_all
	
		*IV coding and descriptives
			*evac order
summarize evac_ord
			
			*age in years
summarize age
			
			*income
tab Q80 income
summarize income

			*education
summarize Q13
		
			*race
summarize nonwhite
			
			*financial stability
generate comfortable=.
replace comfortable=1 if Q59==4
replace comfortable=2 if Q59==3
replace comfortable=3 if Q59==2
replace comfortable=4 if Q59==1
tab Q59 comfortable
summarize comfortable
			
			*home owner
generate ownhome=0
replace ownhome=1 if Q5==1 |Q5==2
tab ownhome
tab Q5 ownhome
summarize ownhome

			*pet owner
generate haspet=.
replace haspet=1 if Q9==1
replace haspet=0 if Q9==2
tab Q9 haspet
summarize haspet
			
			*in flood zone
generate yesflood=.
replace yesflood=1 if Q6==1
replace yesflood=0 if Q6==2
replace yesflood=0 if Q6==3
tab Q6 yesflood
summarize yesflood
			
			*not mobile
summarize notmobile
			
			*perceptions of preparedness
generate prepared=.
replace prepared=1 if Q23==4
replace prepared=2 if Q23==3
replace prepared=3 if Q23==2
replace prepared=4 if Q23==1
tab Q23 prepared
summarize prepared
			
			*perceptions of quality of home's construction
generate goodhouse=.
replace goodhouse=1 if Q24==12
replace goodhouse=2 if Q24==11
replace goodhouse=3 if Q24==10
replace goodhouse=4 if Q24==9
replace goodhouse=5 if Q24==8
tab Q24 goodhouse
summarize goodhouse
			
			*count of supplies on hand
summarize supplied
			
			*"ride it out" mentiality
summarize Q35_19
			
		*analysis: DV = shelter vs all other evac options
logit s_v_all evac_ord age income Q13 nonwhite comfortable ownhome haspet yesflood notmobile prepared goodhouse supplied Q35_19

	*length of stay in shelter (majority, n = 40/65.57% stayed 3 days or less)
tab Q28

	*staisfaction with stay in shelter (most, n = 45/73.7 said 'very' or 'somewhat' satisfied)
tab Q30
means Q30

	*open ended comments re: shelter stay for those who replied 'very' or 'somewhat' dissatsfied at Q30 (n = 8/13.12%)
tab Q30a
		*the comments (n = 8, n = 6 intelligible)
			*Extremely long check-in period to enter shelter - over 2 hours in a line.  No information in advance on what to bring - nothing about sleeping or eating arrangements.  Very chaotic.
			*It was cramped and very unsafe and unorganized.  I trued helping and taking charge but we were treated like animals. Its was embarrassing  and sad since my entire family was there.
			*Lmmjn hklgeabkt hjmbbgfds bkbbfsaz jmnhdaZbnno
			*sdf ertyj  eruyh uytr
			*They weren'��t equipped to handle the number of people.
			*To many people who toke up far more space then they needed and people kept trying to steal peoples belongings
			*Too crowded; had to sleep on a hard floor; noisy; no privacy.
			*Very hot and very crowded

*****

*supplementary analysis: multinomial logit for what people did during irma by demogs
*DV = irma_resp (1 = public shelter, 2 = stay home, 3 = evac w/o public shelter)
*base cateory = stay at home (i.e., all analayses are of the relationships of the demogs with responses take as opposed to stayign home)
mlogit irma_resp age income Q13 nonwhite comfortable ownhome haspet notmobile, b(2)


*****

*STUDY 1: police or no at the shelter, hypothetical "deadly hurricane"
	*text reference: n's by condition
		*control
tab Q49d
		*local police
tab Q49a	
		*local police, warrants
tab Q49b
		*local police, sex offenders
tab Q49c

	*flip scales to run less likely to more likely and to recode 6 to 5
		*control
generate Q49d_=.
replace Q49d_=1 if Q49d==6
replace Q49d_=2 if Q49d==5
replace Q49d_=3 if Q49d==3
replace Q49d_=4 if Q49d==2
replace Q49d_=5 if Q49d==1
tab Q49d Q49d_
		*local police
generate Q49a_=.
replace Q49a_=1 if Q49a==6
replace Q49a_=2 if Q49a==5
replace Q49a_=3 if Q49a==3
replace Q49a_=4 if Q49a==2
replace Q49a_=5 if Q49a==1
tab Q49a Q49a_
		*local police, warrants
generate Q49b_=.
replace Q49b_=1 if Q49b==6
replace Q49b_=2 if Q49b==5
replace Q49b_=3 if Q49b==3
replace Q49b_=4 if Q49b==2
replace Q49b_=5 if Q49b==1
tab Q49b Q49b_
		*local police, sex offenders
generate Q49c_=.
replace Q49c_=1 if Q49c==6
replace Q49c_=2 if Q49c==5
replace Q49c_=3 if Q49c==3
replace Q49c_=4 if Q49c==2
replace Q49c_=5 if Q49c==1
tab Q49c Q49c_
	
	*Figure 2: response to all conditions
		*control
mean Q49d_
		*local police
mean Q49a_	
		*local police, warrants
mean Q49b_
		*local police, sex offenders
mean Q49c_

	*text reference: ANOVA
		*create factor variable for experimental condition
generate cops=.
			*control
replace cops=1 if Q49d !=.
			*local police
replace cops=2 if Q49a !=.
			*warrants
replace cops=3 if Q49b !=.
			*sex offenders
replace cops=4 if Q49c !=.
			*verify n's
tab cops
			*labels
label define cops_label 1 "control" 2 "local police" 3 "warrants" 4 "sex offenders"
label values cops cops_label
tab cops
		*combine responses regardless of exprimental conditon
generate s2response=.
			*control
replace s2response=Q49d_ if cops==1	
			*local police
replace s2response=Q49a_ if cops==2		
			*warrants
replace s2response=Q49b_ if cops==3			
			*sex offenders
replace s2response=Q49c_ if cops==4			
			*verify n's
tab Q49a_
tab Q49b_
tab Q49c_
tab Q49d_
tab s2response
		*anova analysis
bysort cops: means s2response
oneway s2response cops, bonferroni
oneway s2response cops, sidak
		*balance analysis
			*sex
oneway female cops
			*age
oneway age cops
			*income
oneway income cops
			*race
oneway white cops
		*supplementary post-hoc anovas for variaion in reponses
			*irma repsonse (shelter/remain/evac)
anova s2response cops##irma_resp
			*income (7-point scale)
anova s2response cops##inc_above_ave
			*race (non-white/white)
anova s2response cops##white	

*****

*STUDY 2: security provider, hypothetical "deadly hurricane"			
	*text reference: n's by condition
		*local gov't
tab Q50a
		*local police
tab Q50b	
		*county sheriff
tab Q50c
		*state police
tab Q50d	
		*private guards
tab Q50e		

	*flip scales to run less likely to more likely and to recode 6 to 5
		*local gov't
generate Q50a_=.
replace Q50a_=1 if Q50a==5
replace Q50a_=2 if Q50a==4
replace Q50a_=3 if Q50a==3
replace Q50a_=4 if Q50a==2
replace Q50a_=5 if Q50a==1
tab Q50a Q50a_
		*local police
generate Q50b_=.
replace Q50b_=1 if Q50b==5
replace Q50b_=2 if Q50b==4
replace Q50b_=3 if Q50b==3
replace Q50b_=4 if Q50b==2
replace Q50b_=5 if Q50b==1
tab Q50b Q50b_
		*county
generate Q50c_=.
replace Q50c_=1 if Q50c==5
replace Q50c_=2 if Q50c==4
replace Q50c_=3 if Q50c==3
replace Q50c_=4 if Q50c==2
replace Q50c_=5 if Q50c==1
tab Q50c Q50c_
		*state
generate Q50d_=.
replace Q50d_=1 if Q50d==5
replace Q50d_=2 if Q50d==4
replace Q50d_=3 if Q50d==3
replace Q50d_=4 if Q50d==2
replace Q50d_=5 if Q50d==1
tab Q50d Q50d_
		*private
generate Q50e_=.
replace Q50e_=1 if Q50e==5
replace Q50e_=2 if Q50e==4
replace Q50e_=3 if Q50e==3
replace Q50e_=4 if Q50e==2
replace Q50e_=5 if Q50e==1
tab Q50e Q50e_
	
	*Figure 3: response to all conditions
		*local gov't
mean Q50a_
		*local police
mean Q50b_
		*county
mean Q50c_
		*state
mean Q50d_
		*private
mean Q50e_

	*text reference: ANOVA
		*create factor variable for experimental condition
generate source=.
			*local gov't
replace source=1 if Q50a !=.
			*local police
replace source=2 if Q50b !=.
			*cty sheriff
replace source=3 if Q50c !=.
			*state police
replace source=4 if Q50d !=.
			*private guards
replace source=5 if Q50e !=.
			*verify n's
tab source
			*labels
label define source_label 1 "local govt" 2 "local police" 3 "cty sheriff" 4 "state police" 5 "private"
label values source source_label
tab source
		*combine responses regardless of exprimental conditon
generate s3response=.
			*local gov't
replace s3response=Q50a_ if source==1	
			*local police
replace s3response=Q50b_ if source==2		
			*county sheriff
replace s3response=Q50c_ if source==3			
			*state police
replace s3response=Q50d_ if source==4	
			*private guards
replace s3response=Q50e_ if source==5	
			*verify n's
tab Q50a_
tab Q50b_
tab Q50c_
tab Q50d_
tab Q50e_
tab s3response
		*anova analysis
bysort source: means s3response
oneway s3response source, bonferroni
oneway s3response source, sidak
		*balance analysis
			*sex
oneway female source
			*age
oneway age source
			*income
oneway income source
			*race
oneway white source
		*supplementary post-hoc anovas for variaion in reponses
			*irma repsonse (shelter/remain/evac)
anova s3response source##irma_resp
			*income (7-point scale)
anova s3response source##inc_above_ave
			*race (non-white/white)
anova s3response source##white

*****

*STUDY 3: pets, hypothetical "deadly hurricane"	
	*pet ownership summary stats
tab Q9 haspet
mean haspet
		
	*text reference: n's by condition
		*allow pets
tab Q51a
		*no pets
tab Q51b	
	
*flip scales to run less likely to more likely
		*allow pets
generate Q51a_=.
replace Q51a_=1 if Q51a==5
replace Q51a_=2 if Q51a==4
replace Q51a_=3 if Q51a==3
replace Q51a_=4 if Q51a==2
replace Q51a_=5 if Q51a==1
tab Q51a Q51a_
		*no pets
generate Q51b_=.
replace Q51b_=1 if Q51b==5
replace Q51b_=2 if Q51b==4
replace Q51b_=3 if Q51b==3
replace Q51b_=4 if Q51b==2
replace Q51b_=5 if Q51b==1
tab Q51b Q51b_
	
	*Figure 4: response to all conditions
		*allow pets
mean Q51a_
		*no pets
mean Q51b_

	*text reference: ANOVA
		*create factor variable for experimental condition
generate pets=.
			*allow
replace pets=1 if Q51a !=.
			*not allowed
replace pets=2 if Q51b !=.
			*verify n's
tab pets
			*labels
label define pets_label 1 "allow pets" 2 "do not allow pets"
label values pets pets_label
tab pets
		*combine responses regardless of exprimental conditon
generate s4response=.
			*local gov't
replace s4response=Q51a if pets==1	
			*local police
replace s4response=Q51b if pets==2		
			*verify n's
tab Q51a
tab Q51b
tab s4response
		*anova analysis
bysort pets: means s4response
anova s4response pets##haspet
		*balance analysis
			*sex
oneway female pets
			*age
oneway age pets
			*income
oneway income pets
			*race
oneway white pets
		*supplementary post-hoc anovas for variaion in reponses
			*irma repsonse (shelter/remain/evac)
anova s4response pets##irma_resp
			*income (7-point scale)
anova s4response pets##inc_above_ave
			*race (non-white/white)
anova s4response pets##white
			
			
			
			
			

